<?php
class User extends Model{
	protected $dbconfig = "user";
	protected $tbl = "u_user";
    /**
     * 用户登录
     * @param type $mail
     * @param type $pwd
     * @return type
     */
	public function login($mail,$pwd){
		$sql = sprintf("Fmail='%s' AND Fpwd='%s'",$mail,md5($pwd));
		return $this->getRow($sql);
	}
    /**
     * 添加用户
     * @param type $mail
     * @param type $pwd
     * @param type $name
     * @param type $sex
     * @param type $face
     * @param type $mobile
     */
	public function addUser($mail,$pwd,$name,$sex,$face,$mobile = ''){
		
	}
    /**
     * 检查邮箱是否存在
     * @param String $mail
     */
    public function checkMail(String $mail){
        return $this->getVar(sprintf("Fmail='%s'",$mail));
    }
    /**
     * 检查用户的名字是否存在
     * @param String $name
     */
    public function checkName(String $name){
        return $this->getVar(sprintf("Fname='%s'",$name));
    }
	public function forgetPwd(){
		
	}
    /**
     * 修改用户的密码
     * @param int $uid
     * @param String $pwd
     */
	public function resetPwd(int $uid,String $pwd){
		
	}
}
